interface Type {
    [key:string]:any
}

const components:Type = {}

const modules:any = import.meta.glob('./components/**/*.vue', { eager: true }) //eager立即加载

for (const path in modules) {
    const comp = modules[path].default //组件
    if (comp && comp.name) {
        const name = comp.name; // 获取组件名
        components[name] = comp; // 将组件添加到 components 对象中
    }
}

export default components
